package cn.com.interstore.bg.fixture.org;

import org.nakedobjects.applib.fixtures.AbstractFixture;

import cn.com.interstore.bg.dom.org.PaymentMethod;

public class PaymentMethodFixture extends AbstractFixture {
	@Override
	public void install() {
		this.createPaymentMethod("TAOBAO", new Double(0.2));
		this.createPaymentMethod("ICBC", new Double(0.5));
		this.createPaymentMethod("CBC", new Double(0.5));
		
	}

	private void createPaymentMethod(final String name, Double chargeRate) {
		PaymentMethod pm = newTransientInstance(PaymentMethod.class);
		pm.setName(name);
		pm.setChargeRate(chargeRate);
		persist(pm);
	}
}
